import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/style/app.styl'
import '@/style/theme.styl'

const app = createApp(App).use(store).use(router)

// 导入ElementPlus
if (ElementPlus === undefined) {
    var ElementPlus = window.ElementPlus
}
app.use(ElementPlus)

// RemixIcon图标
import RemixIcon from '@/tools/RemixIcon'
app.component('ri', RemixIcon)

import VSep from '@/tools/VSep'
app.component('vsep', VSep)

import {mountComponent} from '@/js/components'
app.config.globalProperties.$mountComponent = (component, props, element) => {
    return mountComponent(app, component, props, element)
}

// axios网络库
if (axios === undefined) {
    var axios = window.axios
}
axios.defaults.headers.post['Countent-Type'] = 'application/json'
app.config.globalProperties.$axios = axios

// Mixins
import mixins from '@/tools/mixins'
app.mixin(mixins)

const emitter = window.mitt()
app.config.globalProperties.$eb= emitter


app.config.devtools = true

// 加载app
app.mount('#app')


window.app = app
